<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
  defined('_JEXEC') or die('Retricted Access');
  $lists = $this->lists;
  JHTML::_('behavior.tooltip');
  global $jbconfig;
?>

<form name="adminForm" action="index.php" method="post">
	
    <div style="width:100%;">
		<table width="100%">
        <tr>
       
        <td valign="top">
        	<?php echo $this->menu_User();?>
        	<br/>
	        <table>        
	        	
				<tr>
					<td align="left" width="100%">
						<?php echo JText::_( 'Filter' ); ?>:
						<input type="text" name="search" id="search" value="<?php echo $this->lists['search'];?>" class="text_area" onchange="document.adminForm.submit();" />					
	                    <button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
						<button onclick="document.getElementById('search').value=''; this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
					</td>
					<td nowrap="nowrap">
						<?php  echo $this->lists['group'];?>
					</td>
				</tr>
			</table>
       
			<table class="adminlist">
	        	<thead>
					<tr>
						<th width="20">
							<?php echo JText::_( 'NUM' ); ?>
						</th>
						<th width="20">
							<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->items); ?>);" />
						</th>
						<th>            		
	            			<?php echo JHTML::_('grid.sort',   JText::_('FEED NAME'), 'u.FeedName',@$lists['filter_order_Dir'], @$lists['filter_order'] ); ?>
	            		</th>	
	            		<th>            		
	            			<?php echo JText::_('URL'); ?>
	            		</th>             		
						<th>            		
	            			<?php echo JHTML::_('grid.sort',   JText::_('SCHEMA'), 'u.SchemaID',@$lists['filter_order_Dir'], @$lists['filter_order'] ); ?>
	            		</th>	            			            		
						<th>            		
	            			<?php echo JHTML::_('grid.sort',   JText::_('ID'), 'u.FeedID',@$lists['filter_order_Dir'], @$lists['filter_order'] ); ?>
	            		</th> 	
	            						
					</tr>
				</thead>
				<tbody>
	        	<?php
	        	$items = $this->items;
	        	
	        	for($i = 0, $n = count($items); $i < $n; $i++){
	        		$item = $items[$i];
	        		$item->checked_out = 0;
					$checked = JHTML::_('grid.checkedout',   $item, $i, "FeedID" );
	        		JFilterOutput::objectHtmlSafe($item);
	        		?>
	        		<tr class="row<?php echo $i%2; ?>">
	            		<td align="center"><?php echo $this->pagination->getRowOffset( $i );  ?></td>            		
	            		<td align="center"><?php echo $checked; ?></td>
	            		<td>
	            			<a href="<?php echo 'index.php?option='. $this->lists['option'] .'&view=jaxmlexport&tab=feeds&task=edit&cid[]='.$item->FeedID ; ?>">
	            				<?php echo $item->FeedName; ?>
	            			</a>
	            		</td>	
	            		<td align="center">
	            		<input type="text" onfocus="this.select();" name="url_<?php echo $item->FeedID; ?>" size="50" value="<?php $xmlurl = JURI::root()."images/stories/jbuploads/".$item->FeedID.str_replace(" ","",$item->FeedName).".xml"; echo $xmlurl; ?>"/><br>
	            		[<a href="<?php echo $xmlurl; ?>" onclick="<?php  $xmldocument = JPATH_SITE.$jbconfig['general']->get('upload_folder',DS.'images'.DS.'stories'.DS.'jbuploads').DS.$item->FeedID.str_replace(" ","",$item->FeedName).".xml"; if(!file_exists($xmldocument) ) { echo "alert('Oops! The file xml of this feed does not exist, please edit information and then retry!'); return false;"; }?>" target="_blank"><?php echo JText::_("PREVIEW");?></a> | <a onclick="<?php if(!file_exists($xmldocument) ) { echo "alert('Oops! The file xml of this feed does not exist, please edit information and then retry!'); return false;"; }?>" target="_blank" href="<?php echo 'index.php?tmpl=component&option='. $this->lists['option'] .'&view=jaxmlexport&tab=feeds&task=downloadFeed&download=true&FeedName='.$item->FeedID.str_replace(" ","",$item->FeedName).'&FeedID='.$item->FeedID ; ?>"><?php echo JText::_("DOWNLOAD");?></a> | <a href="<?php echo 'index.php?option='. $this->lists['option'] .'&view=jaxmlexport&tab=feeds&task=clearcache&FeedID='.$item->FeedID ; ?>"><?php echo JText::_("CLEAR CACHE");?></a>]
	            		</td>
	            		<td><?php echo $item->SchemaName; ?></td>	            		
	            		<td><?php echo $item->FeedID; ?></td>    
	            		             
	            	</tr>
	        	<?php	        		
				}
	        	?>
	        	<tbody>
	        	<tfoot>
					<tr>
						<td colspan="8">
							<?php echo $this->pagination->getListFooter(); ?>
						</td>
					</tr>
				</tfoot>
			</table>
        </td>
        </tr>
        </table>
	</div>
	<input type="hidden" name="option" value="<?php echo $this->lists['option']; ?>" />
	<input type="hidden" name="view" value="jaxmlexport" />
    <input type="hidden" name="task" value="list" />
    <input type="hidden" name="tab" value="feeds" />
    <input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php echo $this->lists['filter_order']; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['filter_order_Dir']; ?>" />
	<?php echo JHTML::_( 'form.token' ); ?>
 </form>
